import util from '@/services/util'
export default {
  namespaced: true,
  state: {
    rtk: '',
    uid: '',
    un: '',
    menuLists: [],
    qjrole: ''
  },
  mutations: {
    resetMenu (state) {
      state.menuLists = []
    },
    resetQjrole (state) {
      state.qjrole = ''
    }
  },
  actions: {
    // 用户初始化
    initUser ({state}) {
      const user = util.getItem('$user_fx') || {}
      Object.assign(state, {
        rtk: user.rtk,
        uid: user.uid,
        un: user.un
      })
    }
  }
}
